<!-- 
 * @Description:
 * @Date: 2024-06-25 21:24:10
 * @LastEditTime: 2024-07-04 08:45:36
-->
<!-- 使用 type="home" 属性设置首页，其他页面不需要设置，默认为page；推荐使用json5，更强大，且允许注释 -->
<route lang="json5" type="page">
{
  style: {
    navigationBarTitleText: '详情',
  },
}
</route>
<template>
  <view class="bg-#fff overflow-auto w-100% h-screen box-border p-20rpx">
    <view class="detail-title">{{ detailList.messageCenterDO?.title }}</view>
    <view class="detail-time">
      {{ formatTime(detailList.messageCenterDO?.createTime, 'yyyy-MM-dd HH:mm:ss') }}
    </view>
    <view class="detail-content">
      {{ detailList.messageCenterDO?.content }}
    </view>
  </view>
</template>

<script lang="ts" setup>
import { getMessageDetail, getWeatherDetail } from '@/service/index/index'
import { formatTime } from '@/utils/index'
const detailList = ref({})
// 获取消息详情
onLoad(async (options) => {
  const data: any = await getMessageDetail(Number(options.id))
  detailList.value = data.data
  console.log('🚀 ~ onLoad ~ data.data:', data.data)
})
// onLoad(async (options) => {
//   const data: any = await getWeatherDetail(Number(options.id))
//   detailList.value = data.data
// })
</script>
<style scoped>
.detail-title {
  font-size: 40rpx;
  line-height: 66rpx;
  color: rgba(63, 63, 63, 1);
  text-align: left;
}
.detail-time {
  font-size: 32rpx;
  line-height: 46rpx;
  color: rgba(144, 144, 144, 1);
  text-align: left;
}
.detail-content {
  font-size: 32rpx;
  line-height: 46rpx;
  color: rgba(63, 63, 63, 1);
  text-align: left;
}
rich-text {
  line-height: 1.7;
}
</style>
